package com.example.service.webhook.business.email.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Lists;

import java.util.List;
@JsonIgnoreProperties(ignoreUnknown=true)
public class EmailBillList {
    @JsonProperty("total_size")
    private Integer totalSize;
    private Integer size;
    private List<EmailBill> bills;

    public EmailBillList() {
        this.totalSize = 0;
        this.size = 0;
    }

    public Integer getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(Integer totalSize) {
        this.totalSize = totalSize;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public List<EmailBill> getBills() {
        return bills;
    }

    public void setBills(List<EmailBill> bills) {
        if (bills != null) {
            this.bills = bills;
            this.size = bills.size();
        }
    }

    public void addBill(EmailBill bill) {
        if (bills == null) {
            bills = Lists.newArrayList();
        }
        bills.add(bill);
        size++;
    }
}
